package com.bs.web.rest;

import com.bs.domain.ServiceInfo;
import com.bs.service.DeployDashService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: rui xu
 * @Date: 2019/4/11 9:42
 */


@Api(value = "deployDash")
@RestController
@RequestMapping("/api/deployDash")
public class DeployDashResource {

    @Autowired
    private DeployDashService deployDashService;

    @GetMapping("/onlineSort")
    public List<ServiceInfo> onlineSortServiceResource(@RequestParam("startTime") String startTime,
                                                 @RequestParam("endTime") String endTime,
                                                 @RequestParam("active") String active
    ) {
        return deployDashService.onlineSortService( startTime, endTime, active);
    }


    @GetMapping("/onlineTrend")
    public List<ServiceInfo> onlineTrendServiceResource(@RequestParam("startTime") String startTime,
                                                       @RequestParam("endTime") String endTime,
                                                       @RequestParam("interval") long interval,
                                                       @RequestParam("active") String active
    ) {
        return deployDashService.onlineTrendService( startTime, endTime, interval,active);
    }
}
